1. Field of the Invention
The present invention relates to duplicate message elimination during recovery when multiple threads are delivering messages from a message store to a destination queue.
2. Description of the Related Art
In a message system environment, an agent may handle the delivery of messages from a message store to a message broker. A message being delivered is indicated in a monitor queue and then added to a destination queue. Once the message is committed to the destination queue, the entry in the monitor queue for the committed message replaces the entry in the monitor queue for the previous message and an acknowledgment (ACK) is sent to the message store. The message store then removes the delivered message from the message store.
In the event of a failure, messages that have not been committed to the destination queue are rolled back from the destination queue and the indication of the message is removed from the monitor queue, so that the previous message that was successfully committed is indicated in the monitor queue. The agent then determines, for each message for which acknowledgment has not been received, whether the identifier for the message is in the monitor queue. If so, acknowledgment is returned to the message store because the message has already been delivered. If there is no message identifier in the monitor queue matching the message being considered, then the message is redelivered to the message broker. The details of this recovery process are further described in the copending and commonly assigned patent application “Duplicate Message Elimination System for a Message Broker”, U.S. application Ser. No. 10/364,738, filed Feb. 11, 2003, which application is incorporated herein by reference in its entirety.